DXL to auto number

I'm very new and never done DXL scripting before.

What I need to do is creat an attribute that is auto numbered. The object IDs can be in any order, but I want to create an attribute that is sequential, any way possible? Here is an example:

[2]: Object Text, 1
[3]: Object Text, 2
[5]: Object Text, 3
[9]: Object Text, 4
10: Object Text, 5
JacKaL424 - Wed Oct 13 15:35:09 EDT 2010

Re: DXL to auto number
rmoskwa - Thu Oct 14 16:19:39 EDT 2010

The following snippet will assign a sequential number to all objects in the present view, which may or may not be filtered. It assumes that SeqNum has already been created as an attribute (of type integer) for the module
 

//Populate a sequence number attribute for all objects in a module
 
/*
Calculates value for SeqNum attribute
*/
 
Object o
int answer
 
answer = 1
for o in all current Module do
{
 o."SeqNum" = answer
 answer = answer + 1
}


If you use
"for o in entire current Module do"
it will populate all objects, even those hidden from view.

If you need to create the attribute, llandale does a through job at
https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14421866&#14421866

If you place the code snippet as SeqNum.dxl in the
C:\Program Files\IBM\Rational\DOORS\9.2\lib\dxl\addins\user
folder (or wherever you dxl addins are located)
you will see "SeqNum" in the User menu bar drop-down list.

Good Luck...